/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package graphics;

import java.awt.GraphicsConfiguration;
import java.awt.GraphicsEnvironment;
import java.awt.image.VolatileImage;
import stealth.Main;

/**
 *
 * @author Joshua
 */
public class Images {

    public static VolatileImage createVolatileImage( int width, int height, int transparency){
	GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
                .getDefaultConfiguration();
	VolatileImage image = null;
	image = gc.createCompatibleVolatileImage(width, height, transparency);
	int valid = image.validate(gc);
	if (valid == VolatileImage.IMAGE_INCOMPATIBLE) {
		image = Images.createVolatileImage(width, height, transparency);
		return image;
	}
	return image;
    }
}
